//
//  DWECollectionViewCell.m
//  休闲吧
//
//  Created by DWE_KJ on 2017/1/5.
//  Copyright © 2017年 loveMe. All rights reserved.
//

#import "DWECollectionViewCell.h"
#import "DWESexView.h"
#import "Masonry.h"
//#import "UIImageView+WebCache.h"
//#import "UIColor+Util.h"

@interface DWECollectionViewCell()
/**
 技师头像
 */
@property (nonatomic, strong) UIImageView *headerImageView;
/**性别*/
@property (nonatomic, strong) DWESexView *sexView;

@end

@implementation DWECollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame])
    {
        [self initWithAddSubView];
    }
    return self;
}

- (void)initWithAddSubView
{
    _headerImageView = [UIImageView new];
    _headerImageView.backgroundColor = [UIColor whiteColor];
    _headerImageView.layer.cornerRadius = 25;
    _headerImageView.layer.masksToBounds = YES;
    [self addSubview:_headerImageView];
    
    _sexView = [DWESexView new];
    _sexView.backgroundColor = [UIColor clearColor];
    [_headerImageView addSubview:_sexView];
    
    [_headerImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.and.top.mas_offset(0);
        make.left.equalTo(_sexView.mas_left).offset(0);
        make.width.and.height.mas_equalTo(50);
    }];
    
    [_sexView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(50);
        make.width.mas_equalTo(50);
    }];

}

//- (void)setUIModel:(DWEHomeModel *)model
//{
//    if (model.headerImgUrl.length)
//    {
//        NSURL *url = [NSURL URLWithString:model.headerImgUrl];
//        [_headerImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"gray_background"]];
//    }
//    [_sexView showSex:model.sex];
//}
@end


@implementation DWENoCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame])
    {
        _promptLable = [[UILabel alloc]initWithFrame:self.bounds];
        _promptLable.textAlignment = NSTextAlignmentCenter;
        _promptLable.textColor = [UIColor whiteColor];
        _promptLable.font = [UIFont systemFontOfSize:13];
        [self addSubview:_promptLable];
    }
    return self;
}
@end
